

<%@ page language="java" import="java.util.*,java.sql.*,com.hostmanagement.util.db.*" pageEncoding="UTF-8"%>
<%@page import="com.hostmanagement.finance.FinanceManage;"%>
<%
		String path = request.getContextPath();
		String basePath = request.getScheme() + "://" + request.getServerName()
				+ ":" + request.getServerPort() + path + "/";
		
		FinanceManage financeManage = new FinanceManage();
		List financeItemList = financeManage.getFinanceItem();
		
		
		
		List list = new ArrayList();
		List houseList = new ArrayList();
		ResultSet rs = null;
		ResultSet rs1 = null;
		Connection con = null;
		Statement stmt = null;
		try{
			String sql = "select a.user_id,b.real_name from user_info a,user_detail_info b where a.user_id=b.user_id and a.rule_id=2";
			con = DBUtil.getConnection();
			stmt = con.createStatement();
			rs = stmt.executeQuery(sql);
			while(rs.next()){
				Map map = new HashMap();
				map.put("userId", rs.getString("user_id"));
				map.put("userName", rs.getString("real_name"));
				
				list.add(map);
			}
			
			
			String sql1 = "select house_id,name from house_info";
			rs1 = stmt.executeQuery(sql1);
			while(rs1.next()){
				Map map = new HashMap();
				map.put("houseId",rs1.getString("house_id"));
				map.put("houseName",rs1.getString("name"));
				
				houseList.add(map);
			}
			
			
			
		}catch(Exception e){
			e.printStackTrace();
		}finally{
			try{
				if(rs != null)
					rs.close();
				if(stmt != null)
					stmt.close();
				if(con != null)
					con.close();
			}catch(Exception e){
				e.printStackTrace();
			}
		}
				


%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>财务信息发布</title>
<LINK href="./css/style.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #5CB7FE;
}
.STYLE1 {font-size: 12px}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
.STYLE7 {font-size: 12px; font-weight: bold; }
.STYLE8 {
	font-size: 16px;
	font-weight: bold;
}
.proccess{border:1px solid;width:8;height:8;margin:3}
-->
 </style>
<link href="/css/style.css" rel="stylesheet" type="text/css">
<link href="/css/msgcss.css" rel="stylesheet" type="text/css">
</head>
<script language="javascript">

 function checkFrm()
 {
	form.submit();
  }
 </script>
<body style="overflow-x:hidden">

<table width="850" height="568" border="0" cellpadding="0"
	cellspacing="0" bordercolor="#D8EDFF">
	<!--DWLayoutTable-->
	<tr>
		<td height="8" colspan="4" valign="top"></td>
		<td width="834" valign="top"></td>
		<td width="5" valign="top"></td>
	</tr>
	<tr>
		<td height="5" colspan="3" align="right" valign="top"><img
			src="images/icon1.jpg" width="6" height="5" /></td>
		<td colspan="2" valign="top"><img src="images/icon2.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon3.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td width="7" height="523">&nbsp;</td>
		<td width="5" align="right" valign="top" background="images/icon5.jpg"><img
			src="images/icon5.jpg" width="5" height="5" /></td>
		<td colspan="2" valign="top" bgcolor="#D8EDFF">&nbsp;</td>
		<td valign="top">
		<table width="100%" border="0" cellpadding="0" cellspacing="0"
			bgcolor="#D8EDFF">
			<!--DWLayoutTable-->
			<tr>
				<td height="59" colspan="3" align="center" valign="middle">
					<span class="STYLE8">发布财务信息</span></td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td width="90" height="345">&nbsp;</td>
				<td width="672" valign="top">
				<FORM action="addFinanceServlet" method="get" name="form" >
				<table width="100%" border=0 cellpadding=0 cellspacing=1
					bgcolor=5cb7fe>
					<!--DWLayoutTable-->
				  <%--- 
				  <tr>
					  <td width="290" height="25" align="right" valign="middle"
							bgcolor="#D8EDFF" class="STYLE1">业主：&nbsp; </td>
					  <td width="373" valign="middle"
							bgcolor="#D8EDFF" class="STYLE1">&nbsp;
					  	<select id="userId" >
					  		<option value="">请选择</option>
					  		<%for(int i=0;i<list.size();i++){ 
					  			Map map = (Map) list.get(i);
					  		%>
					  			<option value="<%=map.get("userId")%>" ><%=map.get("userName") %></option>
					  		
					  		<%
					  		} %>
					  	</select>
				      </td>
				  </tr>
				  --%>
				  <tr>
					  <td width="290" height="25" align="right" valign="middle"
							bgcolor="#D8EDFF" class="STYLE1">物业：&nbsp; </td>
					  <td width="373" valign="middle"
							bgcolor="#D8EDFF" class="STYLE1">&nbsp;
					  	<select id="houseId" name="houseId">
					  		<option value="">请选择</option>
					  		<%for(int i=0;i<houseList.size();i++){ 
					  			Map map = (Map) houseList.get(i);
					  		%>
					  			<option value="<%=map.get("houseId")%>" ><%=map.get("houseName") %></option>
					  		
					  		<%
					  		} %>
					  	</select>
				      </td>
				  </tr>
				  <tr>
					  <td width="290" height="25" align="right" valign="middle"
							bgcolor="#D8EDFF" class="STYLE1">时间：&nbsp; </td>
					  <td width="373" valign="middle"
							bgcolor="#D8EDFF" class="STYLE1">&nbsp;
					  	<input type="text" id="monthTime" name="monthTime" style="height:18px" size="18">(年-月-日)
				      </td>
				  </tr>
				  	

				<%for(int i=0;i<financeItemList.size();i++){ 
				
					Map map = (Map) financeItemList.get(i);
				%>	
                  <tr>
					  <td width="290" height="25" align="right" valign="middle"
							bgcolor="#D8EDFF" class="STYLE1"><%=map.get("value") %>：&nbsp; </td>
					  <td width="373" valign="middle"
							bgcolor="#D8EDFF" class="STYLE1">&nbsp;
						<input type="hidden" name="financeItemKey" value="<%=map.get("key") %>" />	
				      	<input type="text" id="value<%=map.get("key") %>" name="value<%=map.get("key") %>" style="height:18px" size="18">
				      </td>
				  </tr>	
				<%} %>
					<tr>
					  <td height="40" colspan="2" align="center" valign="middle"
							bgcolor="#D8EDFF" class="STYLE1">
							<input name="Submit" type="button" class="btn1_mouseout" onMouseOver="this.className='btn1_mouseover'"
								onmouseout="this.className='btn1_mouseout'" value=" 确 定 " onclick="checkFrm()">
				      		&nbsp;&nbsp;
					  </td>
			      </tr>
				</table>
				</FORM>
				</td>
				<td width="43">&nbsp;</td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td height="43">&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<td>&nbsp;</td>
			</tr>




			<tr>
				<td height="72" colspan="4" valign="top">
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<!--DWLayoutTable-->
					<tr>
						<td width="834" height="72">&nbsp;</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
		<td valign="top" background="images/icon6.jpg"><img
			src="images/icon6.jpg" width="5" height="100%" /></td>
	</tr>



	<tr>
		<td height="5"></td>
		<td valign="top"><img src="images/icon7.jpg" width="5" height="5" /></td>
		<td colspan="3" valign="top"><img src="images/icon8.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon9.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td height="2"></td>
		<td></td>
		<td width="1"></td>
		<td width="6"></td>
		<td></td>
		<td></td>
	</tr>
</table>
</body>
</html>
